import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;

public class LocalNIOCopy {

	public static void main(String[] args) throws IOException {
		if (args.length < 2) {
			System.err.println("Invalid parameters list. Usage: LocalIOCopy <source> <dest> ");
			System.exit(1);
		}
		String src = args[0];
		String dst = args[1];

		long before = System.currentTimeMillis();
		Path srcPath = Paths.get(src);
		Path dstPath = Paths.get(dst);
		Files.copy(srcPath, dstPath, StandardCopyOption.REPLACE_EXISTING);
		long after = System.currentTimeMillis();
		System.out.print("Local NIO : ");
		System.out.println(after - before);
	}
}
